
# for elf_file in `find /mnt/soft/eda/synopsys/vcs/N-2017.12-SP2/linux64/bin -type f `
# for elf_file in `find /mnt/soft/eda/synopsys/vcs/N-2017.12-SP2/linux/bin -type f `
for elf_file in `find /mnt/soft/eda/synopsys/vcs/N-2017.12-SP2/linux* -type f `
do
	if (echo $elf_file |grep -F '.org' &>/dev/null ); then
		# echo $elf_file
		/mnt/soft/work/sample/binutils/bfd-example/patch-elf-bfd $elf_file --func vcs_checkout 31c0c3
		# break
		continue
	fi

	# if(readelf -h $elf_file &>/dev/null); then
	# 	echo $elf_file
	# 	if [ ! -e ${elf_file}.org ]; then
	# 		cp $elf_file ${elf_file}.org
	# 	fi
	# 	/mnt/soft/work/sample/binutils/bfd-example/patch-elf-bfd $elf_file --func vcs_checkout 31c0c3
	# fi

	if (grep vcs_checkout $elf_file &>/dev/null); then
		echo $elf_file
		# if [ ! -e ${elf_file}.org ]; then
		# 	cp $elf_file ${elf_file}.org
		# fi
		/mnt/soft/work/sample/binutils/bfd-example/patch-elf-bfd $elf_file --func vcs_checkout 31c0c3
		# time /mnt/soft/work/sample/binutils/bfd-example/patch-elf-bfd $elf_file w --func vcs_checkout 31c0c3
		# ./patch-elf $elf_file func vcs_checkout 31c0c3
		# break;
	fi
done
